#! /usr/local/bin/perl

$mailprog = '/usr/lib/sendmail';
$recipient = 'info@ywd.com, cindy@shark.ywd.com';

&blank_response unless $ENV{'WWW_Name'};

open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";

print MAIL "To:  $recipient\n";
print MAIL "From: Web Server <nobody\@www.ywd.com>\n";
if ($ENV{'WWW_Email'}) {
    print MAIL "Reply-To: $ENV{'WWW_Name'} <$ENV{'WWW_Email'}>\n";
}
else {
    print MAIL "Reply-To: Web Server <nobody\@www.ywd.com>\n";
}
print MAIL "X-mailer: $ENV{'HTTP_USER_AGENT'}\n";
print MAIL "X-Remote-Host: $ENV{'REMOTE_HOST'} ($ENV{'REMOTE_ADDR'})\n";
print MAIL "X-Remote-User: $ENV{'REMOTE_USER'}\n";
print MAIL "Subject: Cyberprops Catalog Request\n\n";

print MAIL "     Cyberprops Catalog Request\n";
print MAIL "-------------------------------------------\n";
print MAIL "Name................... $ENV{'WWW_Name'}\n";
print MAIL "Title.................. $ENV{'WWW_Title'}\n";
print MAIL "Company................ $ENV{'WWW_Company'}\n";
print MAIL "Address................ $ENV{'WWW_Addrs'}\n";
print MAIL "City................... $ENV{'WWW_City'}\n";
print MAIL "State.................. $ENV{'WWW_State'}\n";
print MAIL "Zip.................... $ENV{'WWW_zip'}\n";
print MAIL "Country................ $ENV{'WWW_Country'}\n";
print MAIL "Phone.................. $ENV{'WWW_Phone'}\n";
print MAIL "Fax.................... $ENV{'WWW_fax'}\n";
print MAIL "Email.................. $ENV{'WWW_Email'}\n\n";
print MAIL "Wants CP Catalog....... $ENV{'WWW_Wants_CP_Catalog'}\n";
print MAIL "Wants Cust Model info.. $ENV{'WWW_Wants_cust_Model'}\n";
print MAIL "Job Function........... $ENV{'WWW_Function'}\n";
print MAIL "Business............... $ENV{'WWW_Business'}\n\n";
print MAIL "3D Platform............ $ENV{'WWW_Platform'}\n";
print MAIL "3D Software............ $ENV{'WWW_3D_Software'}\n";
print MAIL "File Format............ $ENV{'WWW_File_Format'}\n";
print MAIL "Storage Media.......... $ENV{'WWW_Storage'}\n\n";
print MAIL "Publications Read...... $ENV{'WWW_Publications'}\n\n";
print MAIL "Heard About Us From.... $ENV{'WWW_Heard_About'}\n\n";

close (MAIL);

#    ----------------------------------------------------------------------
# Print the html for the user
print "Content-type: text/html\n\n";

print "<HEAD>\n<TITLE>\"Thanks!\"</TITLE>\n<LINK REV=\"made\" HREF=\"mailto:cindy\@shark.ywd.com\">\n</HEAD>\n";
print "<BASEFONT SIZE=4><body bgcolor=\"#37DDF5\" link=\"#960020\" vlink=\"#110094\" alink=\"#FF5AF6\">\n\n";

print "<CENTER><FONT SIZE=\"5>\"Thank You For Requesting Information!<P>";
print "<I>It's on it's way!</I></FONT></CENTER><P>";

    print "<A HREF=\"http://www.ywd.com/index.html\"><B>Return to Home Page</B></A><BR>\n";
print "<HR SIZE=\"10\">\n";
print "<address><FONT SIZE=\"3\">\n";
print "Copyright &copy; 1995 Yglesias Wallock Divekar, Inc., All Rights Reserved<BR>\n";
print "Cyberprops and 3Name3D are trademarks of Yglesias Wallock Divekar, Inc.<BR>\n";
print "Please direct any comments or bug reports to: <A HREF=\"mailto:webmaster\@ywd.com\">webmaster\@ywd.com</A>\n";
print "</ADDRESS>\n";
print "</BODY></BASEFONT></HTML>\n";

sub blank_response
{
    print "Content-type: text/html\n\n";
    print "<HEAD>\n<TITLE>\"Ooops\"</TITLE>\n<LINK REV=\"made\" HREF=\"mailto:cindy\@shark.ywd.com\">\n</HEAD>\n";
    print "<BASEFONT SIZE=\"4\"><body bgcolor=\"#37DDF5\" link=\"#960020\" vlink=\"#110094\" alink=\"#FF5AF6\">\n\n";

    print "<BR>";
    print "<CENTER>Important information was missing from the catalog request form.<BR>";
    print "Please press the &quot;Back&quot; button on your browser to return to it.</CENTER><P>";

    print "<HR SIZE=\"10\">\n";
    print "<address><FONT SIZE=\"3\">\n";
    print "Copyright &copy; 1995 Yglesias Wallock Divekar, Inc., All Rights Reserved<BR>\n";
    print "Cyberprops and 3Name3D are trademarks of Yglesias Wallock Divekar, Inc.<BR>\n";
    print "Please direct any comments or bug reports to: <A HREF=\"mailto:webmaster\@ywd.com\">webmaster\@ywd.com</A>\n";
    print "</ADDRESS>\n";
    print "</BODY></BASEFONT></HTML>\n";

    exit;
}

